package com.hsc.yalebao.adapter;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.hsc.yalebao.model.RuleBaseBean;
import com.hsc.yalebao.tools.UiUtil;
import java.util.ArrayList;

@SuppressLint({"NewApi"})
public class CaishuziGridViewAdapter extends BaseAdapter
{
  private Context context;
  private int currentIndex;
  private LayoutInflater inflater;
  public ArrayList<RuleBaseBean> noticeList;
  private String type = "home";

  public CaishuziGridViewAdapter(Context paramContext, ArrayList<RuleBaseBean> paramArrayList, String paramString)
  {
    this.context = paramContext;
    this.inflater = LayoutInflater.from(paramContext);
    this.noticeList = paramArrayList;
    this.type = paramString;
  }

  public int getCount()
  {
    if (this.noticeList == null)
      return 0;
    return this.noticeList.size();
  }

  public Object getItem(int paramInt)
  {
    return this.noticeList.get(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    ViewHolder localViewHolder;
    if (paramView == null)
    {
      localViewHolder = new ViewHolder();
      paramView = this.inflater.inflate(2130903144, null);
      localViewHolder.lin_content = ((LinearLayout)paramView.findViewById(2131099762));
      localViewHolder.tv_number = ((TextView)paramView.findViewById(2131100154));
      localViewHolder.tv_percent = ((TextView)paramView.findViewById(2131100155));
      paramView.setTag(localViewHolder);
    }
    RuleBaseBean localRuleBaseBean;
    while (true)
    {
      localRuleBaseBean = (RuleBaseBean)this.noticeList.get(paramInt);
      if (localRuleBaseBean != null)
        break;
      return paramView;
      localViewHolder = (ViewHolder)paramView.getTag();
    }
    String str = localRuleBaseBean.getName();
    double d = localRuleBaseBean.getOdds();
    localViewHolder.tv_number.setText(str);
    localViewHolder.tv_percent.setText("1:" + UiUtil.savePoint(d, 1));
    if (this.currentIndex == paramInt)
    {
      localViewHolder.lin_content.setBackgroundResource(2130837663);
      return paramView;
    }
    localViewHolder.lin_content.setBackgroundResource(2130837664);
    return paramView;
  }

  public void setData(ArrayList<RuleBaseBean> paramArrayList)
  {
    this.noticeList = paramArrayList;
  }

  public void setSelection(int paramInt)
  {
    this.currentIndex = paramInt;
  }

  public class ViewHolder
  {
    public LinearLayout lin_content;
    public TextView tv_number;
    public TextView tv_percent;

    public ViewHolder()
    {
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.adapter.CaishuziGridViewAdapter
 * JD-Core Version:    0.6.2
 */